// let conf = {
// 	ur: "http://" + window.location.host,
// 	storage: window.localStorage
// };
let conf = {
	ur: "http://localhost:8080",
	storage: window.localStorage
};
let userToken = conf.storage.getItem("userToken");

function doPost(purl, datas) {
	if (userToken === "" || userToken === undefined) {
		alert("请先登录！");
		return;
	}
	$.ajax({
		url: conf.ur + purl,
		type: 'post',
		dataType: 'json',
		data: JSON.stringify(datas),
		headers: {
			"x-auth-token": userToken,
			"Content-Type": "application/json"
		},
		success: (data) => {
			return {
				"status": 0,
				"data": data
			};
		},
		error: (err) => {
			return {
				"status": -1,
				"data": err
			};
		}
	});
}
